<div class="page">
    <div class="bg-box">
        <img *ngIf="config" src="{{config.background}}" alt="">
    </div>
    <device-title>{{config?.name}}</device-title>
    <div class="content">
        <div class="text">
            数据面板
        </div>
        <div class="data-list">
            <div class="data-box" *ngFor="let item of items1" (click)="selectItem(item)">
                <data-box [config]="item"></data-box>
            </div>
        </div>
        <div class="line">
            <div class="title">近期 {{currentItem?.name}} 数据</div>
            <line-chart [config]="currentItem"></line-chart>
        </div>
        <div class="text">
            控制中心
        </div>
        <div class="ctrl-list">
            <ng-container *ngFor="let item of items3">
                <div class="ctrl-box" *ngIf="item.type=='switch'">
                    <ctrl-box [config]="item" (stateChange)="stateChange($event,item)"></ctrl-box>
                </div>
                <div class="ctrl-box" *ngIf="item.type=='input'">
                    <input-box [config]="item" (textChange)="textChange($event)"></input-box>
                </div>
                <div class="ctrl-box" *ngIf="item.type=='button'">
                    <btn-box [config]="item" (click)="onClick(item)"></btn-box>
                </div>
            </ng-container>
        </div>
        <div style="height: 30px;"></div>
    </div>
    <setting-btn></setting-btn>
</div>